import {
	get,
	post,
	put,
	del,
	request
} from "./http.js";

const Api = {
	Yingshi: {
		Token: () => get(`/api/yingshi/token`)
	},
	Device: {
		Add: (params) => post(`/company/api/device/store`, params),
		List: (params) => get(`/company/api/device`, params),
		Del: (id, params) => del(`/company/api/device/${id}`, params),
		Update: (id, params) => put(`/company/api/device/${id}`, params),
	},
	Thumbsup: {
		Thumbsup: (type, id, params) => post(`/api/thumbsup/${type}/${id}`, params),
	},
	Login: {
		Session: (params) => post(`/company/api/login/mini/session`, params),
		Mobile: (params) => post(`/company/api/login/mini/mobile`, params),
		Silent: (params) => post(`/company/api/login/mini/silent`, params),
		Login: (params) => post("/api/login", params)
	},
	Decorate: {
		List: (params) => post(`/company/api/decorate`, params),
		List_C: (params) => get(`/api/decorate`, params),
		Add: (params) => post(`/company/api/decorate/store`, params),
		AddMobile: (params) => post(`/company/api/decorate/store/mobile`, params),
		Detail: (id) => get(`/company/api/decorate/${id}/detail`),
		Detail_C: (id) => get(`/api/decorate/${id}/detail`),
		Del: (id) => del(`/company/api/decorate/${id}`),
		Info: (id) => get(`/company/api/decorate/${id}/detail`),
		Update: (id, params) => put(`/company/api/decorate/${id}`, params),
		Put:(decorate_id,user_id)=>put(`/company/api/decorate/${decorate_id}/user/${user_id}`),
		Change: (id, type) => get(`/company/api/decorate/${id}/${type}`),
		Process: {
			Sort: (params) => put(`/company/api/process/sort`, params),
			Del: (decorate_id, id) => del(`/company/api/decorate/${decorate_id}/process/${id}`),
			Add: (id, params) => post(`/company/api/decorate/${id}/process/store`, params)
		},
		Device: {
			Add: (id, params) => post(`/company/api/decorate/${id}/device/store`, params),
			Del: (id, id2, params) => del(`/company/api/decorate/${id}/device/${id2}`),
			Update: (id, params) => put(`/company/api/decorate/device/${id}   `, params),
		},
	},
	Administrator: {
		List: (params) => get(`/company/api/administrator`, params),
		Del: (id) => del(`/company/api/administrator/${id}`),
		Add: (params) => post(`/company/api/administrator/${params.user_id}`, params),
		Detail: (id) => get(`/company/api/administrator/${id}`),
		Update: (id, params) => put(`/company/api/administrator/${id}`, params),
	},

	My: {
		Decorate: (params) => post(`/company/api/my/decorate`, params),
		Detail: (params) => get(`/company/api/my/detail`, params),
		Authorizer: {
			List: (params) => post(`/company/api/my/authorizer`, params)
		},
		Active: (params) => post(`/company/api/my/submission`, params),
		Home: () => get(`/api/my/home`),
		Followings(params) {
			return get("/api/my/followings", params);
		},
	},
	Aliyun: {
		Image: {
			Create: (params) => post(`/company/api/aliyun/image/token/create`, params)
		},
		Video: {
			Create: (params) => post(`/company/api/aliyun/video/token/create`, params)
		}
	},
	Video: {
		Add: (params) => post(`/company/api/video/store`, params)
	},
	Active: {
		Add: (params) => post(`/company/api/activity/store`, params),
		List: (id, params) => get(`/company/api/decorate/${id}/activity`, params),
		List_C: (id, params) => get(`/api/decorate/${id}/activity`, params),
		AllList: (params) => post(`/api/activity`, params),
		Del: (id) => del(`/company/api/activity/${id}`),
		Verify: (id, params) => put(`/company/api/activity/${id}/verify`, params),
		Detail: (id) => get(`/company/api/activity/${id}/detail`),
		upDate: (id, params) => put(`/company/api/activity/${id}`, params),
		Latest: (params) => get(`/company/api/activity/decorate/latest`, params),
	},
	Compound: {
		Project: {
			List: (params) => get(`/company/api/aliyun/clip/list`, params),
			Detail: (params) => get(`/company/api/aliyun/clip`, params),
		},
		Create: (params) => post(`/company/api/aliyun/clip/video/create`, params)
	},
	Video: {
		Add: (params) => post(`/company/api/video/store`, params),
		Del: (id) => del(`/company/api/video/${id}`),
	},
	Image: {
		Add: (params) => post(`/company/api/image/store`, params),
		Del: (id) => del(`/company/api/image/${id}`),
		List: (params) => post(`/company/api/media/image`, params),
		DelMedia: (id) => del(`/company/api/media/image/${id}`),
		Update: (id, params) => put(`/company/api/image/${id}`, params),
	},
	Home: {
		List: (params) => get(`/api/home`)
	},
	Style: {
		List: (params) => get(`/company/api/style`, params),
		Add: (params) => post(`/company/api/style/store`, params),
		Del: (id) => del(`/company/api/style/${id}`),
		Info: (id) => get(`/company/api/style/${id}`),
		Update: (id, params) => put(`/company/api/style/${id}`, params),
	},
	Layout: {
		List: (params) => get(`/company/api/layout`, params),
		Add: (params) => post(`/company/api/layout/store`, params),
		Del: (id) => del(`/company/api/layout/${id}`),
		Info: (id) => get(`/company/api/layout/${id}`),
		Update: (id, params) => put(`/company/api/layout/${id}`, params),
	},
	Edit: {
		Nickname: (params) => post(`/api/my/detail/nickname`, params),
	},
	Shop: {
		All: () => get(`/company/api/company/all`),
		Active: (params) => post(`/company/api/activity`, params),
		Detail: (id) => get(`/company/api/company/detail`),
		Detail_C: (id) => get(`/api/company/detail`),
		Update: (params) => put(`/company/api/company`, params),
		Add: (params) => post(`/company/api/company/store`, params),
		Members: {
			List: (params) => get(`/api/company/member`, params),
		}
	},
	Process: {
		List: (params) => get(`/company/api/process`, params),
		Sort: (params) => put(`/company/api/process/sort`, params),
		Del: (id) => del(`/company/api/process/${id}`),
		Update: (id, params) => put(`/company/api/process/${id}`, params),
		Add: (params) => post(`/company/api/process/store`, params)
	},
	Administrator_role: {
		List: (params) => post(`/company/api/administrator_role`, params),
		Del: (id) => del(`/company/api/administrator_role/${id}`),
		Detail: (id) => get(`/company/api/administrator_role/${id}`),
		Info: () => get(`/company/api/administrator_role/add`),
		Add: (params) => post(`/company/api/administrator_role/store`, params),
		Update: (id, params) => put(`/company/api/administrator_role/${id}`, params),
	},
	Members: {
		List(params) {
			return post("/company/api/member", params);
		},
	},
	Relative: {
		Add: (params) => post(`/api/my/relative/store`, params),
		List: (params) => post(`/api/my/relative`, params),
	},
	User: {
		Relative: (id, params) => get(`/api/user/${id}/relative`, params),
	},
	Comment: {
		List: (id, params) => get(`/api/comment/activity/${id}`, params),
		Add: (id, params) => post(`/api/comment/activity/${id}/submit`, params),
		ListReply: (id, params) => get(`/api/comment/${id}/answer`, params),
	},
	Order: {
		postOrder: (params) => post(`/company/api/order/payment/wechat/mini`, params),

	},
	Platform: {
		List: () => get(`/company/api/company/role`),
		Detail: (id) => get(`/company/api/company/role/${id}`),
		Order: {
			Create: (params) => post(`/company/api/order/role`, params)
		}
	},
};

export default Api;